<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:s="http://jboss.com/products/seam/taglib"
  template="/WEB-INF/templates/template.xhtml"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:rich="http://richfaces.org/rich">
  
  <ui:define name="head">
  </ui:define>
<ui:define name="editArticulo">
   <center >
   <br />
	<h:outputText value="Maestro de articulos"  styleClass="tituloabm"/>
   <br />
	<br /> 	
   <div class ="divabm">
   
   <h:form  id = "savearticuloform" rendered="#{appUser.userLogin != null}">
    	<h:panelGrid columns="1">
    		<h:outputText value="#{messages.edithelparticulo}" styleClass="outputcommon" />
    	</h:panelGrid>
    	<h:panelGrid columns= "3">
    		<h:outputText value="#{messages.editcode}" styleClass="outputcommonbold" />
    		<h:inputText id = "codigo" value="#{articuloCtrl.articuloSelected.codigo}"  />
    		<h:message for="codigo" style="color:red" />
    	</h:panelGrid>	
    	<h:panelGrid columns= "3">
    		<h:outputText value="#{messages.editdescripcion}" styleClass="outputcommonbold" />
    		<h:inputText id = "descripcion" value="#{articuloCtrl.articuloSelected.descripcion}"  />
    		<h:message for="descripcion" style="color:red" />
    	</h:panelGrid>	
    	<h:panelGrid columns= "2">	
    		<h:outputText value="#{messages.editformato}" styleClass="outputcommonbold"/>
    		<h:selectOneMenu value="#{articuloCtrl.articuloSelected.formato}" converter="#{formatoadapter.converter}" >
    				<f:selectItems value="#{formatoadapter.items}"/>
    		</h:selectOneMenu>
    	</h:panelGrid>
    	<br />
		<br />
    	<h:panelGrid columns="3">
    			<h:commandLink action="admin-articulo.jsf" styleClass="commandLink">
    				<h:commandButton action="#{articuloCtrl.clearData}" value ="Volver" styleClass="volverbutton" />
	   		   </h:commandLink>
	   		   <h:commandButton action="#{articuloCtrl.removeArticulo}" value="Eliminar" styleClass="eliminarbutton" rendered="#{articuloCtrl.articuloSelected.id != null}"/>
	   		    <h:commandButton action="#{articuloCtrl.saveArticulo}" value ="Guardar" styleClass="guardarbutton"  />
    	</h:panelGrid>
    	<h:panelGrid columns="1">
    			<h:outputText id="savesuccessmsg" value="#{messages.savesuccess}" rendered = "#{articuloCtrl.saveSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;font-family: Arial;"/>
    			<h:outputText id="deletesuccessmsg" value="#{messages.deletesuccess}" rendered = "#{articuloCtrl.deleteSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;font-family: Arial;"/>
    	</h:panelGrid>
    	
    </h:form>
	
	</div>
	</center>
	</ui:define>
<ui:define name="body">
 </ui:define>    	
 </ui:composition>

